package com.groupexercises.object;

/**
 * --- 代码敲对！ ---
 *
 * @author CCCccc
 * @create 2025/8/6
 * 备注：用户类，用于存储用户，包括用户id字段、用户名字段、密码字段、权限字段
 */
public class User {
    // 用户id字段
    private int uid;
    // 用户名字段
    private String username;
    // 密码字段
    private String password;
    // 权限字段
    private int permissions;

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", permissions=" + permissions +
                '}';
    }

    // 构造方法，用于创建用户对象
    public User(int uid, String username, String password, int permissions) {
        this.uid = uid;
        this.username = username;
        this.password = password;
        this.permissions = permissions;
    }

    // 无参构造方法
    public User() {
    }

    // 获取用户id
    public int getUid() {
        return uid;
    }

    // 设置用户id
    public void setUid(int uid) {
        this.uid = uid;
    }

    // 获取用户名
    public String getUsername() {
        return username;
    }

    // 设置用户名
    public void setUsername(String username) {
        this.username = username;
    }

    // 获取密码
    public String getPassword() {
        return password;
    }

    // 设置密码
    public void setPassword(String password) {
        this.password = password;
    }

    // 获取权限
    public int getPermissions() {
        return permissions;
    }

    // 设置权限
    public void setPermissions(int permissions) {
        this.permissions = permissions;
    }
}
